﻿namespace PhotobucketNet
{
    using System;
    using System.Xml;

    public class UploadOptions
    {
        private bool _autoTagging;
        private ImageSize _defaultImageSize;

        internal static UploadOptions CreateFromXmlResponseMessage(XmlResponseMessage responseMessage)
        {
            UploadOptions options = new UploadOptions();
            XmlNode node = responseMessage.ResponseXml.SelectSingleNode("descendant::content");
            XmlNode node2 = node.SelectSingleNode("descendant::defaultimagesize");
            options.SetDefaultImageSize = PhotobucketImageSize.CreateFromString(node2.InnerText);
            XmlNode node3 = node.SelectSingleNode("descendant::autotagging");
            options._autoTagging = bool.Parse(node3.InnerText);
            return options;
        }

        public bool AutoTagging
        {
            get
            {
                return this._autoTagging;
            }
        }

        public ImageSize DefaultImageSize
        {
            get
            {
                return this._defaultImageSize;
            }
        }

        internal bool SetAutoTagging
        {
            set
            {
                this._autoTagging = value;
            }
        }

        internal ImageSize SetDefaultImageSize
        {
            set
            {
                this._defaultImageSize = value;
            }
        }
    }
}

